package com.xingu.xg.po;

import lombok.*;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class TreeU {
    int id;
    int tier;
    int sequence;
    int father;
    int childrenCount;
    String info;
    List<TreeU> children;

    public TreeU(Tree tree) {
        this.id = tree.id;
        this.tier = tree.tier;
        this.sequence = tree.sequence;
        this.father = tree.father;
        this.childrenCount = tree.childrenCount;
        this.info = tree.info;
    }

    public Tree getTree(){
        return new Tree(this.id, this.tier,this.sequence, this.father,this.childrenCount, this.info);
    }

    @Override
    public String toString() {
        return "Tree{" +
                "id=" + id +
                ", tier=" + tier +
                ", sequence=" + sequence +
                ", father=" + father +
                ", childrenCount=" + childrenCount +
                ", info='" + info + '\'' +
                ", children='" + children + '\'' +
                '}';
    }
}
